package com.prod.system.service.impl;

import com.prod.common.utils.DateUtils;
import com.prod.system.domain.TShop;
import com.prod.system.mapper.TShopMapper;
import com.prod.system.service.ITShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 店铺列表Service业务层处理
 *
 * @author zhw
 * @date 2024-05-09
 */
@Service
public class TShopServiceImpl implements ITShopService {
    @Autowired
    private TShopMapper tShopMapper;

    /**
     * 查询店铺列表
     *
     * @param id 店铺列表主键
     * @return 店铺列表
     */
    @Override
    public TShop selectTShopById(Long id) {
        return tShopMapper.selectTShopById(id);
    }

    /**
     * 查询店铺列表列表
     *
     * @param tShop 店铺列表
     * @return 店铺列表
     */
    @Override
    public List<TShop> selectTShopList(TShop tShop) {
        return tShopMapper.selectTShopList(tShop);
    }

    /**
     * 新增店铺列表
     *
     * @param tShop 店铺列表
     * @return 结果
     */
    @Override
    public int insertTShop(TShop tShop) {
        tShop.setCreateTime(DateUtils.getNowDate());
        return tShopMapper.insertTShop(tShop);
    }

    /**
     * 修改店铺列表
     *
     * @param tShop 店铺列表
     * @return 结果
     */
    @Override
    public int updateTShop(TShop tShop) {
        tShop.setUpdateTime(DateUtils.getNowDate());
        return tShopMapper.updateTShop(tShop);
    }

    /**
     * 批量删除店铺列表
     *
     * @param ids 需要删除的店铺列表主键
     * @return 结果
     */
    @Override
    public int deleteTShopByIds(Long[] ids) {
        return tShopMapper.deleteTShopByIds(ids);
    }

    /**
     * 删除店铺列表信息
     *
     * @param id 店铺列表主键
     * @return 结果
     */
    @Override
    public int deleteTShopById(Long id) {
        return tShopMapper.deleteTShopById(id);
    }
}
